<!DOCTYPE html>
<html>

<head lang="en">
    <title>旅游视频</title>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <link rel="stylesheet" href="/js/bootstrap/css/bootstrap.css">
    <script src="/js/jquery/jquery.min.js"></script>
    <script src="/js/bootstrap/js/bootstrap.min.js"></script>
    <link rel="stylesheet" href="/css/font/css/font-awesome.min.css"/>
    <link rel="stylesheet" href="/css/reset.css"/>
    <link rel="stylesheet" href="/css/strategyComment.css"/>
    <script src="/js/plugins/jrender/jrender.js"></script>
    <link rel="stylesheet" href="/js/plugins/jquery-confirm/css/jquery-confirm.css">
    <script src="/js/plugins/jquery-confirm/js/jquery-confirm.js"></script>
    <script src="/js/plugins/jquery-form/jquery.form.js"></script>
    <link rel="stylesheet" href="/js/plugins/dialog/dialog.css">
    <script src="/js/plugins/dialog/dialog.min.js"></script>
    <script src="/js/plugins/hivideo-master/hivideo.js"></script>
    <link rel="stylesheet" href="/js/plugins/hivideo-master/assets/hivideo.css">
    <script src="/js/common.js"></script>
    <style>
        #inputDiv {
            height: 45px;
            width: 100%;
            background-color: #4d4c4d;
            position: fixed;
            bottom: 0;
        }
    </style>
</head>

<body>
<div class="search-head">
    <div class="row nav-search">
        <div class="col">
            <a href="javascript:window.history.go(-1)">
                <span><i class="fa fa-chevron-left"></i></span>
            </a>

        </div>
        <div class="col">
            <span>骡友视频</span>
        </div>
        <div class="col"></div>
    </div>
</div>

<div class="container videos">
    <hr>
    <div class="videos">
        <div class="row" render-loop="list">
            <div class="col-6">
                <a  render-key="list.id" render-fun="handle">
                    <img class="rounded" width="100%" height="110px"
                         render-src="list.imgUrl">
                </a>
                <div class="caption">
                    <a>
                        <p render-html="list.title"></p>
                    </a>
                    <p>
                        <span> </span>
                        <i class="fa fa-video-camera" >&nbsp;<span render-html="list.lookNum"></span>播放</i>
                        <span style="float: right" render-html="list.user.nickName"></span>
                    </p>
                </div>
            </div>
        </div>
    </div>
</div>


<div id="inputDiv">
    <div class="row nav-search">
        <div class="col-1">
            <div class="input-group-sm search">
            </div>
        </div>
        <div class="col-9">
            <div class="input-group-sm search">
                <h4 style="color: #e9ecef">&nbsp;&nbsp;&nbsp;---我要上传---</h4>
            </div>
        </div>
    </div>
</div>

<div id="push"></div>
</body>
<script>
    var user = sessionStorage.getItem("user");
    user = JSON.parse(user);
    var currentPage = 1;
    var pages;
    var videos;
    $(function () {
        $.get("/videos",{pageSize:10},function (data) {
            pages = data.pages;
            videos = data.list;
            renderView(data);
        });
        //设置窗口的滚到事件
        $(window).scroll(function () {
            if (isEnd()) {
                if (currentPage < pages) {
                    currentPage++;
                    $.get("/videos",{currentPage:currentPage,pageSize:10}, function (data) {
                        //数据渲染
                        $.merge(videos, data.list);
                        renderView({list: videos});
                    });
                } else {
                    $(document).dialog({
                        type : "notice",
                        infoText: "就这么多了  (°ー°〃)",
                        autoClose: 1500,
                        position: "bottom"
                    });
                }
            }
        });
        $("#inputDiv").click(function () {
            location.href = "/mine/addVideo.html";
        });
    });
    function renderView(data) {
        $(".videos").renderValues(data,{
            handle:function (ele, value) {
                ele.href="/video.html?id=" + value;
            }
        })
    }
</script>

</html>